package xyz.xpman.prisonerfitness.util;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Point;
import android.os.Build;

import org.jetbrains.annotations.NotNull;

@SuppressWarnings("unused")
public class ScreenUtil {

    private ScreenUtil() {}



    public static Point getWindowsSize(@NotNull final Activity activity) {
        Point outSize = new Point();
        activity.getWindow().getWindowManager().getDefaultDisplay().getSize(outSize);

        return outSize;
    }


    @SuppressLint("ObsoleteSdkInt")
    public static Point getWindowsRealSize(@NotNull final Activity activity) {
        Point outSize = new Point();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            activity.getWindowManager().getDefaultDisplay().getRealSize(outSize);
        }
        return outSize;
    }


    public static Point getScreenSize(@NotNull final Activity activity) {
        return getWindowsRealSize(activity);
    }


}
